/*
 *  class CCSTime implement
 */

#include "stdafx.h"
#include "CSTime.h"

CCSTime::CCSTime()
{}

CCSTime::CCSTime(const TCHAR *chDateTime)
{
	int nYear, nMonth, nDay, nHour, nMin, nSec;
	sscanf(chDateTime, "%d/%d/%d %d:%d:%d", &nMonth, &nDay, &nYear, &nHour, &nMin, &nSec);
	m_cst = CTime(nYear, nMonth, nDay, nHour, nMin, nSec);
}

CCSTime::CCSTime(const string &strDateTime)
{
	int nYear, nMonth, nDay, nHour, nMin, nSec;
	sscanf(strDateTime.c_str(), "%d/%d/%d %d:%d:%d", &nMonth, &nDay, &nYear, &nHour, &nMin, &nSec);
	m_cst = CTime(nYear, nMonth, nDay, nHour, nMin, nSec);
}

CCSTime::~CCSTime()
{
}

CTimeSpan CCSTime::operator - (CCSTime cst) const throw( )
{
	return m_cst - cst.m_cst;
}
/*-------------------------------------    */